package com.cz.video.website.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cz.video.common.core.mapper.BaseMapperPlus;
import com.cz.video.website.domain.WebsiteLike;
import com.cz.video.website.domain.vo.WebsiteLikeVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 点赞 Mapper 接口
 * </p>
 *
 * @author
 * @since 2023-07-09
 */
public interface WebsiteLikeMapper extends BaseMapperPlus<WebsiteLike,WebsiteLike, WebsiteLikeVo> {
    /**
     * 根据条件分页查询点赞数据
     *
     * @param queryWrapper 查询条件
     * @param clientUserId
     * @return 课程场景数据分页信息
     */
    Page<WebsiteLikeVo> selectPageList(@Param("page") Page<WebsiteLike> page,
                                      @Param(Constants.WRAPPER) Wrapper<WebsiteLike> queryWrapper,
                                      @Param("clientUserId") Long clientUserId);

    /**
     * 根据条件查询点赞数据
     *
     * @param queryWrapper 查询条件
     * @return 点赞数据集合信息
     */
    List<WebsiteLikeVo> selectWebsiteLikeList(@Param(Constants.WRAPPER) Wrapper<WebsiteLike> queryWrapper);

    /**
     * 根据点赞来源查询点赞详情
     *
     * @param sourceId
     * @param type
     * @return
     */
    Set<Long> selectUserIdsBySourceId(@Param("sourceId") Long sourceId, @Param("type") int type);
}
